package com.yuanfeng.business.dto;

import com.yuanfeng.business.vo.GoodsListVO;
import com.yuanfeng.commoms.util.TimeStampUtil;
import com.yuanfeng.commoms.util.querypage.PageHelper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
 * @ClassName FxGoodsInfoDTO
 * @Description
 * @Author liulh
 * @Date 2023/8/9 17:16
 * @Version 1.0
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class FxGoodsInfoDTO extends PageHelper {

    /**
     * 商品ID
     */
    private Integer id;

    /**
     * 商品名称
     */
    private String goodsName;

    /**
     * 市场价格
     */
    private String scPrice;

    /**
     * 成本价格
     */
    private String cbPrice;

    /**
     * 平台价格
     */
    private String pcPrice;

    /**
     * 商品状态
     */
    private Integer goodsStatus;

    /**
     * 销售数量
     */
    private String saleNums;

    /**
     * 商品库存数量
     */
    private String goodsNums;

    /**
     * 奖励类型
     */
    private Integer rewardType;

    /**
     * 推广比例
     */
    private String tgRate;

    /**
     * 分销比例
     */
    private String fxRate;

    /**
     * 推广佣金
     */
    private BigDecimal tgCommission;

    /**
     * 分销佣金
     */
    private BigDecimal fxCommission;

    /**
     * 订单数量
     */
    private Integer orderNum;

    /**
     * 商店ID
     */
    private Integer shopId;

    /**
     * 商店名称
     */
    private String shopName;

    /**
     * 商店用户ID
     */
    private String shopUserId;

    /**
     * 自定义变量1
     */
    private String var1;

    /**
     * 自定义变量2
     */
    private String var2;

    /**
     * 自定义变量3
     */
    private String var3;

    /**
     * 自定义变量4
     */
    private String var4;

    /**
     * 创建时间
     */
    private String createTime;

    /**
     * 更新时间
     */
    private String updateTime;

    /**
     * 数据状态
     */
    private Integer dataStatus;

    /**
     * 商品ID
     */
    private Integer goodsId;

    /**
     * 通用ID
     */
    private Integer commonId;



    public FxGoodsInfoDTO(String saleNums,Integer shopId, Integer goodsId) {
        this.saleNums = saleNums;
        this.shopId = shopId;
        this.goodsId = goodsId;
    }

    public FxGoodsInfoDTO(Integer id, Integer goodsStatus) {
        this.id = id;
        this.goodsStatus = goodsStatus;
    }

    public FxGoodsInfoDTO(GoodsListVO goodsList, OperateFxGoodsDTO addRemoveFxGoods) {
        this.goodsId = goodsList.getGoodsId();
        this.goodsName = goodsList.getGoodsName();
        this.scPrice = goodsList.getGoodsMarketPrice().doubleValue()+"";
        this.cbPrice = goodsList.getGoodsCostPrice().doubleValue()+"";
        this.pcPrice = goodsList.getGoodsPrice().doubleValue()+"";
        this.goodsStatus = 1;
        this.rewardType = addRemoveFxGoods.getRewardType();
        this.orderNum = addRemoveFxGoods.getOrderNum();
        this.tgRate = addRemoveFxGoods.getTgRate();
        this.fxRate = addRemoveFxGoods.getFxRate();
        this.shopId = addRemoveFxGoods.getShopId();
        this.shopUserId = addRemoveFxGoods.getUserId().toString();
        this.createTime = TimeStampUtil.getNowDate();
        this.updateTime = TimeStampUtil.getNowDate();
    }
}
